/**
 * 
 */
package com.redsoft.spirit.dao;

import java.util.List;

import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import com.redsoft.spirit.entity.DeptEmp;

/**
 * @author 杨雷
 *
 */
public interface DeptEmpRepository extends BaseRepository<DeptEmp, String> {

	DeptEmp findByEmpIdAndDeptId(String userId, String deptId);

	DeptEmp findByEmpId(String userId);

	@Modifying
	@Query("delete from DeptEmp a where a.empId in ?1")
	void deleteDeptUsers(List<String> userIds);
}
